#include<iostream>
#include<vector>

using namespace std;

int main()
{
	int n;
	cin >> n;
	/*vector<int> arr;
	for (int i = 0; i < n; i++)
	{
		int num;
		cin >> num;
		arr.push_back(num);
	}*/

	/*int arr[100005];
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
	}*/

	vector<int> arr(n);
	for (int i = 0; i < n; i++)
	{
		cin >> arr[i];
	}

	long long ret = 0;
	long long sum = 0;
	long long sq = 0;
	for (int i = 0; i < n; i++)
	{
		sum += arr[i];
		sq += arr[i] * arr[i];
	}
	ret = (sum * sum - sq) / 2;
	/*for (int i = 0; i < n; i++)
	{
		for (int j =i + 1; j < n; j++)
		{
			ret += arr[i] * arr[j];	
		}
	}*/


	cout << ret;
	return 0;
}